/*
 * @Author: ReinerLau lk850593913@gmail.com
 * @Date: 2022-09-14 13:24:35
 * @LastEditors: ReinerLau lk850593913@gmail.com
 * @LastEditTime: 2022-10-28 13:31:30
 * @FilePath: \robot\src\api\robot-camera.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from "@/utils/request";

/**
 * @description: 根据机器人编码和类型获取绑定的摄像头
 * @param {*} code 机器人编码
 * @param {*} type 机器人类型
 * @return {*}
 */
export function getByCode(code, type) {
  return request({
    url: `/camera/v1/getbyrid/${code}&${type}`,
    method: "get",
  });
}

export function getCameraList(params) {
  return request({
    url: "/camera/v1/",
    method: "get",
    params: params,
  });
}

export function setCameraRid(params) {
  return request({
    url: "/camera/v1/updateToRid",
    method: "post",
    params: params,
  });
}

export function fetchList(params) {
  return request({
    url: "/camera/v1/",
    method: "get",
    params: params,
  });
}

export function createRobotCamera(data) {
  return request({
    url: "/camera/v1/",
    method: "post",
    data: data,
  });
}

export function deleteRobotCamera(id) {
  return request({
    url: `/camera/v1/${id}`,
    method: "delete",
  });
}

export function updateRobotCamera(id, data) {
  return request({
    url: `/camera/v1/`,
    method: "put",
    data: data,
  });
}

export function getCamera(id) {
  return request({
    url: `/camera/v1/getone/${id}`,
    method: "get",
  });
}
